package com.mi.system.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * User VO
 *
 * @author jin_huaquan
 * @version 1.0
 * @date 2021/11/3 15:42
 */
@ApiModel(value = "UserVO对象", description = "用户信息")
@Data
public class UserVO implements Serializable {

    @ApiModelProperty(value = "用户ID", required = true, dataType = "java.lang.String")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "部门ID", dataType = "java.lang.String")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long deptId;

    @ApiModelProperty(value = "部门名称", dataType = "java.lang.String")
    private String deptName;

    @ApiModelProperty(value = "账号", required = true)
    private String username;

    @ApiModelProperty(value = "账号密码", hidden = true)
    @JsonIgnore
    private String password;

    @ApiModelProperty(value = "手机号", required = true)
    private String mobile;

    @ApiModelProperty(value = "是否启用", required = true)
    private Integer enabled;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "创建时间", required = true)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "用户的角色集合", required = true)
    private List<RoleVO> roles;
}
